package com.bocai.mapper;

import com.bocai.bean.OrderInfo;
import com.bocai.vo.OrderInfoVo;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface OrderInfoMapper {
    int deleteByPrimaryKey(Integer orderId);

    int insert(OrderInfo record);

    int insertSelective(OrderInfo record);

    OrderInfo selectByPrimaryKey(Integer orderId);

    OrderInfo selectByOrderNumber(String orderNumber);

    /**
     * 统计明细
     * @param orderInfo
     * @return
     */
    List<Map<String,Object>> selectOrderCountDetail(OrderInfo orderInfo);


    /**
     * 统计
     * @param orderInfo
     * @return
     */
    List<Map<String,Object>> selectOrderCount(OrderInfo orderInfo);

    /**
     * 查询用户的订单
     * userId
     * state 状态 2为已完成，1为未完成，null为全部
     * @param map
     * @return
     */
    List<OrderInfo> selectByUserId(Map<String,Object> map);

    /**
     * 查询marketId 和 orderState 订单
     *
     * @param record
     * @return
     */
    List<OrderInfo> selectByMarketId(OrderInfo record);

    /**
     * 查询指定订单
     * @param map
     * @return
     */
    List<OrderInfoVo> selectOrderManager(Map<String,Object> map);

    int updateByPrimaryKeySelective(OrderInfo record);

    int updateByPrimaryKey(OrderInfo record);

    /**
     * @param {"status":2,"orderNumber":"",isWin:1}
     * @return
     */
    int updateStatusByOrderNumber(HashMap<String, Object> map);

    BigDecimal selectMoneyNum();
}